<!DOCTYPE HTML>
<!--
	Dimension by HTML5 UP
	html5up.net | @ajlkn
	Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
 <head>
  <title>
   Dimension by HTML5 UP
  </title>
  <!-- <meta charset="utf-8" /> -->
  <!-- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" /> -->
  <meta charset="utf-8"/>
  <meta content="width=device-width,initial-scale=1.0" name="viewport"/>
  <link href="../../assets/css/article.css" rel="stylesheet"/>
  <link href="https://cdn.bootcss.com/highlight.js/9.15.8/styles/github.min.css" rel="stylesheet"/>
  <noscript>
   <link href="../../assets/css/noscript.css" rel="stylesheet"/>
  </noscript>
 </head>
 <body>
  <div id="app">
  </div>
  <!-- built files will be auto injected -->
 </body>
 <body class="is-preload">
  <!-- Wrapper -->
  <div id="wrapper">
   <!-- Main -->
   <div id="main">
    <article id="article">
     <h1 id="docker">
      Docker 镜像使用记录
     </h1>
     <hr/>
     <h2 id="mysql">
      MySQL
     </h2>
     <h3 id="_1">
      使用记录
     </h3>
     <ul>
      <li>
       拉取官方镜像：docker pull mysql
      </li>
      <li>
       <p>
        运行镜像：docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql:latest
       </p>
       <ul>
        <li>
         -p:将容器的3306端口映射到宿主机的3306端口
        </li>
        <li>
         -e:设置mysql的root用户的密码为root
        </li>
       </ul>
      </li>
      <li>
       <p>
        遇到sock之类的错误，删文件，在重启后再重启
       </p>
      </li>
     </ul>
     <h2 id="neo4j">
      Neo4j
     </h2>
     <p>
      ```shell script
docker run -dit --name neo4j -p 7474:7474 -p 7687:7687 --env=NEO4J_AUTH=none neo4j:3.5.13
     </p>
     <div class="codehilite">
      <pre><span></span><code><span class="o">##</span> <span class="n">Redis</span>
<span class="o">```</span><span class="n">shell</span> <span class="n">script</span>
<span class="n">docker</span> <span class="n">run</span> <span class="o">-</span><span class="n">dit</span> <span class="c1">--name redis -p 6379:6379 redis</span>

<span class="n">docker</span> <span class="n">run</span> <span class="o">-</span><span class="n">d</span> <span class="c1">--name redis -p 6379:6379 redis --requirepass "password"</span>
</code></pre>
     </div>
     <h2 id="mongodb">
      MongoDB
     </h2>
     <p>
      ```shell script
docker run -dit --name mongo -p 27017:27017 mongo
     </p>
     <div class="codehilite">
      <pre><span></span><code><span class="err">## Nginx</span>
<span class="err">```shell script</span>
<span class="err">docker run -dit --name nginx -p 80:80 -v D:/temp/nginx.conf:/etc/nginx/nginx.conf nginx</span>
</code></pre>
     </div>
     <h2 id="docker-activemq">
      docker-activemq
     </h2>
     <p>
      ```shell script
docker run -dit --name activemq -p 11616:61616 -p 8161:8161 -p 1883:1883 rmohr/activemq
     </p>
     <div class="codehilite">
      <pre><span></span><code><span class="err">初始账号：</span>
<span class="k">admin</span> <span class="k">admin</span>
<span class="k">user</span> <span class="k">user</span>

<span class="o">##</span> <span class="n">docker</span> <span class="n">rabbitmq</span>
<span class="o">```</span><span class="n">shell</span> <span class="n">script</span>
<span class="n">docker</span> <span class="n">run</span> <span class="o">-</span><span class="n">dit</span> <span class="c1">--name rabbitmq -p 5672:5672 rabbitmq</span>
</code></pre>
     </div>
     <h3 id="zookeeper">
      zookeeper
     </h3>
     <p>
      ```shell script
docker run -dit --name zk -p 2181:2181 zookeeper
     </p>
     <div class="codehilite">
      <pre><span></span><code><span class="cp">### Kong</span>
<span class="o">-</span> <span class="p">[</span><span class="n">Documentation</span> <span class="k">for</span> <span class="n">Kong</span> <span class="n">Gateway</span> <span class="p">(</span><span class="n">OSS</span><span class="p">)](</span><span class="nl">https</span><span class="p">:</span><span class="c1">//docs.konghq.com/gateway-oss/2.2.x/)</span>
<span class="o">-</span> <span class="p">[</span><span class="n">Docker</span> <span class="n">Installation</span><span class="p">](</span><span class="nl">https</span><span class="p">:</span><span class="c1">//docs.konghq.com/install/docker/?_ga=2.15676593.643431049.1616122322-97521002.1616122322)</span>

<span class="err">```</span><span class="n">shell</span> <span class="n">script</span>
<span class="cp"># linux</span>
<span class="n">docker</span> <span class="n">run</span> <span class="o">-</span><span class="n">d</span> <span class="o">--</span><span class="n">name</span> <span class="n">kong</span> \
     <span class="o">--</span><span class="n">network</span><span class="o">=</span><span class="n">kong</span><span class="o">-</span><span class="n">net</span> \
     <span class="o">-</span><span class="n">v</span> <span class="s">"kong-vol:/usr/local/kong/declarative"</span> \
     <span class="o">-</span><span class="n">e</span> <span class="s">"KONG_DATABASE=off"</span> \
     <span class="o">-</span><span class="n">e</span> <span class="s">"KONG_DECLARATIVE_CONFIG=/usr/local/kong/declarative/kong.yml"</span> \
     <span class="o">-</span><span class="n">e</span> <span class="s">"KONG_PROXY_ACCESS_LOG=/dev/stdout"</span> \
     <span class="o">-</span><span class="n">e</span> <span class="s">"KONG_ADMIN_ACCESS_LOG=/dev/stdout"</span> \
     <span class="o">-</span><span class="n">e</span> <span class="s">"KONG_PROXY_ERROR_LOG=/dev/stderr"</span> \
     <span class="o">-</span><span class="n">e</span> <span class="s">"KONG_ADMIN_ERROR_LOG=/dev/stderr"</span> \
     <span class="o">-</span><span class="n">e</span> <span class="s">"KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl"</span> \
     <span class="o">-</span><span class="n">p</span> <span class="mi">8000</span><span class="o">:</span><span class="mi">8000</span> \
     <span class="o">-</span><span class="n">p</span> <span class="mi">8443</span><span class="o">:</span><span class="mi">8443</span> \
     <span class="o">-</span><span class="n">p</span> <span class="mf">127.0.0.1</span><span class="o">:</span><span class="mi">8001</span><span class="o">:</span><span class="mi">8001</span> \
     <span class="o">-</span><span class="n">p</span> <span class="mf">127.0.0.1</span><span class="o">:</span><span class="mi">8444</span><span class="o">:</span><span class="mi">8444</span> \
     <span class="nl">kong</span><span class="p">:</span><span class="n">latest</span>


<span class="cp"># windows</span>
<span class="n">docker</span> <span class="n">run</span> <span class="o">-</span><span class="n">d</span> <span class="o">--</span><span class="n">name</span> <span class="n">kong</span> <span class="err">`</span>
     <span class="o">--</span><span class="n">network</span><span class="o">=</span><span class="n">kong</span><span class="o">-</span><span class="n">net</span> <span class="err">`</span>
     <span class="o">-</span><span class="n">v</span> <span class="s">"kong-vol:/usr/local/kong/declarative"</span> <span class="err">`</span>
     <span class="o">-</span><span class="n">e</span> <span class="s">"KONG_DATABASE=off"</span> <span class="err">`</span>
     <span class="o">-</span><span class="n">e</span> <span class="s">"KONG_DECLARATIVE_CONFIG=/usr/local/kong/declarative/kong.yml"</span> <span class="err">`</span>
     <span class="o">-</span><span class="n">e</span> <span class="s">"KONG_PROXY_ACCESS_LOG=/dev/stdout"</span> <span class="err">`</span>
     <span class="o">-</span><span class="n">e</span> <span class="s">"KONG_ADMIN_ACCESS_LOG=/dev/stdout"</span> <span class="err">`</span>
     <span class="o">-</span><span class="n">e</span> <span class="s">"KONG_PROXY_ERROR_LOG=/dev/stderr"</span> <span class="err">`</span>
     <span class="o">-</span><span class="n">e</span> <span class="s">"KONG_ADMIN_ERROR_LOG=/dev/stderr"</span> <span class="err">`</span>
     <span class="o">-</span><span class="n">e</span> <span class="s">"KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl"</span> <span class="err">`</span>
     <span class="o">-</span><span class="n">p</span> <span class="mi">8000</span><span class="o">:</span><span class="mi">8000</span> <span class="err">`</span>
     <span class="o">-</span><span class="n">p</span> <span class="mi">8443</span><span class="o">:</span><span class="mi">8443</span> <span class="err">`</span>
     <span class="o">-</span><span class="n">p</span> <span class="mf">127.0.0.1</span><span class="o">:</span><span class="mi">8001</span><span class="o">:</span><span class="mi">8001</span> <span class="err">`</span>
     <span class="o">-</span><span class="n">p</span> <span class="mf">127.0.0.1</span><span class="o">:</span><span class="mi">8444</span><span class="o">:</span><span class="mi">8444</span> <span class="err">`</span>
     <span class="nl">kong</span><span class="p">:</span><span class="n">latest</span>
</code></pre>
     </div>
     <h2 id="_2">
      参考链接
     </h2>
     <ul>
      <li>
       <a href="https://hub.docker.com/_/mysql">
        mysql
       </a>
      </li>
     </ul>
    </article>
   </div>
   <!-- Footer -->
   <footer id="footer">
    <p class="copyright">
     © Untitled. Design:
     <a href="https://html5up.net">
      HTML5 UP
     </a>
     .
    </p>
   </footer>
  </div>
  <!-- BG -->
  <div id="bg">
  </div>
  <!-- Scripts -->
  <script src="../assets/js/jquery.min.js">
  </script>
  <script src="../assets/js/browser.min.js">
  </script>
  <script src="../assets/js/breakpoints.min.js">
  </script>
  <script src="../assets/js/util.js">
  </script>
  <script src="../assets/js/main.js">
  </script>
 </body>
</html>
